package cn.hxzy.mapper;

import cn.hxzy.domain.Task;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author niuyi
 * @since 2024-06-22
 */
public interface TaskMapper extends BaseMapper<Task> {

    @Select("SELECT * \n" +
            "FROM sys_task\n" +
            "WHERE task_id IN (\n" +
            "\tSELECT section_id \n" +
            "\tFROM `sys_section` \n" +
            "\tWHERE chapter_id IN (\n" +
            "\t\tSELECT chapter_id \n" +
            "\t\tFROM sys_chapter\n" +
            "\t\tWHERE course_id=#{courseId}))")
    List<Task> selectTaskByCourseId(Integer courseId);
}
